import request from '@/utils/request'

// 查询订单列表
export function listOrder(data) {
  return request({
    url: '/vehice/tbl-order/selectOrder',
    method: 'post',
    data: data
  })
}

//查询当前用户的所有订单
export function driverAllListOrder(data) {
  return request({
    url: '/vehice/tbl-order/selectAllByDriverId',
    method: 'post',
    data: data
  })
}

export function userAllListOrder(data) {
  return request({
    url: '/vehice/tbl-order/selectAllByUserId',
    method: 'post',
    data: data
  })
}

// 查询订单详细
export function listOrderNumber(data) {
  return request({
    url: '/vehice/tbl-order/selectOrderNumber',
    method: 'post',
    data: data
  })
}

// 查询订单详细
export function getOrder(orderNumber) {
  return request({
    url: '/system/order/' + orderNumber,
    method: 'get'
  })
}

// 新增订单
export function addOrder(data) {
  return request({
    url: '/system/order',
    method: 'post',
    data: data
  })
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/system/order',
    method: 'post',
    data: data
  })
}

// 删除订单
export function delOrder(orderNumber) {
  return request({
    url: '/vehice/tbl-order/deleteOrderNumber/' + orderNumber,
    method: 'delete'
  })
}

// 导出订单
export function Export(data) {
  return request({
    url: '/vehice/tbl-order/export',
    method: 'post',
    data: data
  })
}
